import {
  Column,
  CreateDateColumn,
  Entity,
  PrimaryGeneratedColumn,
  UpdateDateColumn,
} from 'typeorm';

@Entity({ name: 'notify' })
export class Notify {
  @PrimaryGeneratedColumn({ comment: '主键ID' })
  id: number;

  @Column({ type: 'varchar', length: 255, comment: '消息类型' })
  type: string;

  @Column({ type: 'varchar', length: 255, comment: '消息标题' })
  title: string;

  @Column({ type: 'text', comment: '消息内容' })
  content: string;

  @Column({ type: 'text', comment: '额外信息' })
  payload: string;

  @Column({ type: 'varchar', length: 36, nullable: true, comment: '发送人id' })
  sender_id: string;

  @Column({ type: 'varchar', length: 36, comment: '接收人id' })
  receiver_id: string;

  @Column({ type: 'int', comment: '状态' })
  status: number;

  @Column({ type: 'int', nullable: true, comment: '推送状态' })
  push_status: number;

  @Column({ type: 'datetime', nullable: true, comment: '已读时间' })
  read_at: Date;

  @CreateDateColumn({ type: 'datetime', comment: '创建时间' })
  created_at: Date;

  @UpdateDateColumn({ type: 'datetime', comment: '更新时间' })
  updated_at: Date;
}
